<template>

  <div class="newbag">
       <div class="shopdis">
           <span class="iconfont icon-jiantou2" @click="goback()"></span>   
           <span>新人礼包</span>
      </div>
      <img src="https://brup.shengri.cn/goods/2019/03/FtWSnPbtFfmBbV--NWe8kuBK2F4c.jpg-w6" alt="" @click="fun()" ref="change">
  </div>
</template>

<script>
export default {
methods:{
    fun(){
if(localStorage.getItem("token")=="" || localStorage.getItem("token")==null){
            let goLogin = window.confirm("亲，您还没有登录哦，请先登录");
            if (goLogin) {
                this.$router.push("DAccountLogin");
            }                      
        }else{
               this.$refs.change.src="https://brup.shengri.cn/goods/2019/03/FkUjBOixWmDoFaru5TQEGOgEX1q0.jpg-w6"
           localStorage.setItem("coupon","coupon")
        }
    },
    goback(){
       this.$router.go(-1)
   } 
},
mounted(){
           if(localStorage.getItem("coupon","coupon")){
               this.$refs.change.src="https://brup.shengri.cn/goods/2019/03/FkUjBOixWmDoFaru5TQEGOgEX1q0.jpg-w6"
           }
}
}
</script>

<style scoped>

@import '../../../public/flower/iconfont.css';
.shopdis .iconfont{
     font-size: 0.2rem;
     margin-right: 1.2rem;
}
.shopdis{
    width:100%;
    height: 0.65rem;
    line-height: 0.65rem;
    font-size: 0.18rem;
    padding: 0 0.08rem;
    box-sizing: border-box;
    background-color: #fff;
    border-bottom: 0.01rem solid #eeeeee;
    z-index: 333;
}
.newbag{

    width: 100%;
}
.newbag img{
      display: block;
    width: 100%;
    border: 0;
}

</style>